<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>练习</title>
	<style>
		*{padding:0;margin:0;}
		body{
			height: 1000px;
		}

	</style>

	<script>
		function $(id){return document.getElementById(id);}

		window.onload = function (){
			//1.元素对象的获取
			var bodyNode = document.getElementsByTagName("body")[0];
			//2.监听鼠标移动时.
			bodyNode.addEventListener("mousemove",function (e){
				console.log(e.clientX + "  ===   " + e.clientY);
				$("div1").innerHTML = e.clientX + "  ===   " + e.clientY;
			})

		}
	</script>
</head>
<body  >
	<!--在浏览器内容移动鼠标.显示鼠标的坐标.	-->

	<div id="div1">

	</div>


</body>
</html>